package com.xiyi.shouxin.controller.pojo;

import java.util.List;

import com.xiyi.shouxin.entity.admin.Menu;

import lombok.Data;

@Data
public class MenuParams {
    private Long id;
    private String name;
    private String path;
    private String title;
    /*
     * 1：需要权限，0：不需要
     */
    private Integer requiresAuth;
    private Integer order;
    private String icon;
    /*
     * 1：固定页，0：不固定
     */
    private Integer pinTab;
    /*
     * 菜单类型：'dir','page'
     */
    private String menuType;
    /*
     * 组件路径
     */
    private String componentPath;
    /*
     * 父级id
     */
    private Long pid;
    private List<Long> roleIds;

    public Menu toMenu() {
        Menu menu = new Menu();
        menu.setId(id);
        menu.setName(name);
        menu.setPath(path);
        menu.setTitle(title);
        menu.setRequiresAuth(requiresAuth);
        menu.setOrder(order);
        menu.setIcon(icon);
        menu.setPinTab(pinTab);
        menu.setMenuType(menuType);
        menu.setComponentPath(componentPath);
        menu.setPid(pid);
        return menu;
    }
}
